// JavaScript Document
function validate(){
	
	var empno = document.getElementById('txtEmpno');	
    

		if(notEmpty(empno, "Emp/Reg no cannot be empty")){
			  if(isNumeric(empno, "Emp/Reg should be Numeric")){
                 
	                              loadXMLDoc()
	                             
	
			             
                   }
            return false;
			}
	return false;
	}
	
	function loadXMLDoc()
{


if (window.XMLHttpRequest)
  {// code for IE7+, Firefox, Chrome, Opera, Safari
  xmlhttp=new XMLHttpRequest();
  }
else
  {// code for IE6, IE5
  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
xmlhttp.onreadystatechange=function()
  {
  if (xmlhttp.readyState==4 && xmlhttp.status==200)
    {
    document.getElementById("ajaxDiv").innerHTML=xmlhttp.responseText;
	
	
    }
  }

 var id = document.getElementById('txtId').value;	  
var level=document.getElementById('sltLevel').value;	
var empno = document.getElementById('txtEmpno').value;	
var sta=document.getElementById('sltStatus').value;
	
	var queryString ="?level=" + level +"&empno="+empno +"&status="+sta+"&id="+id;
	
xmlhttp.open("GET","../logic/update/user_update.php"+queryString ,true);
xmlhttp.send();
}

	
	
	
	
	
   function backxx()
                {

	var startrow=document.getElementById('startrow').value;
	var tag=document.getElementById('tag').value;
	
	if(tag ==1){
		
		document.location="../admin/admin_home.php?tab=user_search&page="+startrow;
		}else {
			document.location="user_searchx.php?page="+startrow;
			}
	
	}
	
	
	
	function checkregno(){

var empno = document.getElementById('txtEmpno');	
if(notEmpty(empno, "Emp/Reg no cannot be empty")){



 if (window.XMLHttpRequest)
  {// code for IE7+, Firefox, Chrome, Opera, Safari
   xmlhttp=new XMLHttpRequest();
    }
  else
   {// code for IE6, IE5
 xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
     }
    xmlhttp.onreadystatechange=function()
     {
 if (xmlhttp.readyState==4 && xmlhttp.status==200)
  {
									//document.getElementById("ajaxDiv").innerHTML=xmlhttp.responseText; 
									 
   var x=xmlhttp.responseText;
if(x=="false"){
									
  document.getElementById("ajaxDiv1").innerHTML="Invalid Input No";
  document.getElementById('txtEmpno').value="";
	}else{
  document.getElementById("ajaxDiv1").innerHTML=x; 
									
			}
			}
            }
								
  var y=document.getElementById('txtEmpno').value;
  var queryString ="?regno=" + y;
  xmlhttp.open("GET","../logic/load/check_reg_emp.php"+queryString,true);
  xmlhttp.send();	  
	
	
}
}

